Skip to content

Conversation

IvanMenov
Copy link
Contributor

No description provided.

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

75.0% 75.0% Coverage
0.0% 0.0% Duplication


**Output:** \[null, null, null, 1, 1, false\]

**Explanation:** MyQueue myQueue = new MyQueue(); myQueue.push(1); // queue is: \[1\] myQueue.push(2); // queue is: \[1, 2\] (leftmost is front of the queue) myQueue.peek(); // return 1 myQueue.pop(); // return 1, queue is \[2\] myQueue.empty(); // return false
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It may be changed with ident format.

assertThat(stack.top, equalTo(2));

assertThat(stack.pop(), equalTo(2));

Copy link
Owner

@javadev javadev Nov 27, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The empty lines may be removed.


**Output:** \[null, null, null, 2, 2, false\]

**Explanation:** MyStack myStack = new MyStack(); myStack.push(1); myStack.push(2); myStack.top(); // return 2 myStack.pop(); // return 2 myStack.empty(); // return False
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It may be changed with the ident format.


public int calculate(String s) {
char[] ca = s.toCharArray();

Copy link
Owner

@javadev javadev Nov 27, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The empty line may be removed.

strB.append("->").append(b);
}

ranges.add(strB.toString());
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The empty line may be removed.

int popValue = queueOne.remove();
queueOne.addAll(queueTwo);
queueTwo.clear();

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The empty line may be removed.

}

public int helper(char[] ca) {

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The empty line may be removed.

@javadev javadev merged commit 34c3862 into javadev:main Nov 27, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants